<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Схема разработана Центром по разработке СЭМД ЦНИИОИЗ 2021 -->
<!-- Включены элементы разработанные Health Level Seven -->
<xs:schema  
	xmlns:mif="urn:hl7-org:v3/mif" xmlns="urn:hl7-org:v3" 
	xmlns:xs="http://www.w3.org/2001/XMLSchema" 
	targetNamespace="urn:hl7-org:v3" 
	elementFormDefault="qualified" 
	xmlns:address="urn:hl7-ru:address" 
	xmlns:fias="urn:hl7-ru:fias" 
	xmlns:identity="urn:hl7-ru:identity" 
	xmlns:hl7="urn:hl7-org:v3" >
	<!--
*****************************************************************************************************************
*
* Copyright (c) 2002, 2003, 2004, 2005 Health Level Seven. All rights reserved.
*  Redistribution and use in source and binary forms, with or without
*  modification, are permitted provided that the following conditions
*  are met:
*  1. Redistributions of source code must retain the above copyright
*     notice, this list of conditions and the following disclaimer.
*  2. Redistributions in binary form must reproduce the above copyright
*     notice, this list of conditions and the following disclaimer in the
*     documentation and/or other materials provided with the distribution.
*  3. All advertising materials mentioning features or use of this software
*     must display the following acknowledgement:
*       This product includes software developed by Health Level Seven.
*  THIS SOFTWARE IS PROVIDED BY HEALTH LEVEL SEVEN, INC. AND CONTRIBUTORS "AS IS" AND
*  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
*  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
*  ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
*  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
*  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
*  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
*  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
*  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
*  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
*  SUCH DAMAGE.
*
********************************************************************************************************************
	  -->
	<xs:import namespace="urn:hl7-ru:fias" schemaLocation="fias.xsd"/>
	<xs:import namespace="urn:hl7-ru:address" schemaLocation="address.xsd"/>
	<xs:import namespace="urn:hl7-ru:identity" schemaLocation="identity.xsd"/>
	<xs:include schemaLocation="coreschemas/datatypes.xsd"/>
	<xs:include schemaLocation="coreschemas/voc.xsd"/>
	<xs:include schemaLocation="coreschemas/NarrativeBlock.xsd"/>
	
	<xs:complexType name="POCD_MT000040.Component2">
		<xs:sequence>
			<xs:element name="structuredBody" type="POCD_MT000040.StructuredBody" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>тело документа</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
	</xs:complexType>
	<xs:complexType name="POCD_MT000040.StructuredBody">
		<xs:sequence>
			<xs:element name="component" type="POCD_MT000040.Component3" minOccurs="3" maxOccurs="5">
				<xs:annotation>
					<xs:documentation></xs:documentation>
				</xs:annotation>
				<xs:key name="SectionCodeKey">
					<xs:selector xpath=".//hl7:section/hl7:code" />
					<xs:field xpath="@code" />
				</xs:key>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
	</xs:complexType>
	<xs:complexType name="POCD_MT000040.Component3">
		<xs:sequence>
			<xs:element name="section" type="POCD_MT000040.Section" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>секция документа</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
	</xs:complexType>
	<xs:complexType name="POCD_MT000040.Section">
		<xs:sequence>
			<xs:element name="code" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>код секции</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:complexContent>
						<xs:restriction base="CE_non_elements">
							<xs:attribute name="code" use="required">
								<xs:simpleType>
									<xs:restriction base="cs">
										<xs:enumeration value="DOCINFO"/>
										<xs:enumeration value="BENEFITS"/>
										<xs:enumeration value="DGN"/>
										<xs:enumeration value="CONSENT"/>
										<xs:enumeration value="LINKDOCS"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:attribute>
							<xs:attribute name="codeSystem" type="uid" use="required" fixed="1.2.643.5.1.13.13.99.2.197"/>
							<xs:attribute name="codeSystemName" type="st" use="required"/>
							<xs:attribute name="codeSystemVersion" type="st" use="required"/>
							<xs:attribute name="displayName" type="st" use="required"/>							
							<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
						</xs:restriction>
					</xs:complexContent>
				</xs:complexType>
			</xs:element>
			<xs:element name="title" type="ST_non_NF" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>заголовок секции</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="text" type="StrucDoc.Text" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>наполнение секции</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="entry" type="POCD_MT000040.Entry" minOccurs="1" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation></xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
	</xs:complexType>
	<xs:complexType name="POCD_MT000040.Entry">
		<xs:sequence>
			<xs:choice> <!-- что-то должно быть -->
				<xs:element name="observation" type="POCD_MT000040.Observation" minOccurs="1" maxOccurs="1">
					<xs:annotation>
						<xs:documentation></xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element name="act" type="POCD_MT000040.Act" minOccurs="1" maxOccurs="1">
					<xs:annotation>
						<xs:documentation></xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:choice>
		</xs:sequence>
		<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
	</xs:complexType>
	<xs:complexType name="POCD_MT000040.Observation">
		<xs:sequence>
			<xs:element name="code" minOccurs="1" maxOccurs="1"> <!-- обязательный R [1..1] -->
				<xs:annotation>
					<xs:documentation>кодируемое поле</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:complexContent>
						<xs:restriction base="CE_non_elements">
							<xs:attribute name="code" type="cs" use="required"/>
							<xs:attribute name="codeSystem" use="required">
								<xs:simpleType>
									<xs:restriction base="uid">
										<xs:enumeration value="1.2.643.5.1.13.13.11.1077"/>
										<xs:enumeration value="1.2.643.5.1.13.13.99.2.166"/>										
									</xs:restriction>
								</xs:simpleType>
							</xs:attribute>
							<xs:attribute name="codeSystemName" type="st" use="required"/>
							<xs:attribute name="codeSystemVersion" type="st" use="required"/>
							<xs:attribute name="displayName" type="st" use="required"/>
							<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
						</xs:restriction>
					</xs:complexContent>
				</xs:complexType>
			</xs:element>
			<xs:choice minOccurs="0"> <!-- мин=0 -->
				
				<xs:sequence>
						<xs:element name="text" type="ED_text" minOccurs="0" maxOccurs="1">
							<xs:annotation>
								<xs:documentation>врачебное описание диагноза</xs:documentation>
							</xs:annotation>
						</xs:element>
						<xs:element name="value" type="ANY" minOccurs="1" maxOccurs="1">
							<xs:annotation>
								<xs:documentation>наполнение кодируемого поля</xs:documentation>
							</xs:annotation>
						</xs:element>						
				</xs:sequence>
				<xs:sequence>
					<xs:element name="effectiveTime" type="TS" minOccurs="1" maxOccurs="1">
						<xs:annotation>
							<xs:documentation></xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="value" type="ANY" minOccurs="0" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>наполнение кодируемого поля</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
				<xs:sequence>
					<xs:element name="participant" minOccurs="1" maxOccurs="1">
						<xs:annotation>
							<xs:documentation/>
						</xs:annotation>
						<xs:complexType>
							<xs:sequence>
								<xs:element name="participantRole" minOccurs="1"
									maxOccurs="1">
									<xs:annotation>
										<xs:documentation/>
									</xs:annotation>
									<xs:complexType>
										<xs:sequence>
											<xs:element name="id" type="II" minOccurs="1"
												maxOccurs="1"/>
											<xs:element name="addr" minOccurs="1" maxOccurs="1">
												<xs:annotation>
													<xs:documentation>Адрес МО-ВМП</xs:documentation>
												</xs:annotation>
												<xs:complexType>
													<xs:choice minOccurs="0">
														<xs:group ref="AD"/>
													</xs:choice>
													<xs:attribute name="use" use="optional" type="set_PostalAddressUse"/>
													<xs:attribute name="nullFlavor" type="NullFlavor" use="optional"/>
												</xs:complexType>
											</xs:element>
											<xs:element name="telecom" type="TEL" minOccurs="0" maxOccurs="unbounded">
												<xs:annotation>
													<xs:documentation>Контакты МО-ВМП</xs:documentation>
												</xs:annotation>
											</xs:element>
											<xs:element name="playingEntity" minOccurs="1"
												maxOccurs="1">
												<xs:complexType>
													<xs:sequence>
														<xs:element ref="identity:Props"
															minOccurs="0" maxOccurs="1"/>
														<xs:element name="name" 
															minOccurs="1" maxOccurs="1"/>
													</xs:sequence>
													<xs:attribute name="nullFlavor" type="NullFlavor"
														use="prohibited"/>
												</xs:complexType>
											</xs:element>
										</xs:sequence>
										<xs:attribute name="nullFlavor" type="NullFlavor"
											use="prohibited"/>
										<xs:attribute name="classCode"
											type="RoleClassRoot" use="required"/>
									</xs:complexType>
								</xs:element>
							</xs:sequence>
							<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
							<xs:attribute name="typeCode" type="ParticipationType" use="required"/>
						</xs:complexType>
					</xs:element>
				</xs:sequence>
			</xs:choice>
		</xs:sequence>
		<xs:attribute name="classCode" type="ActClassObservation" use="required" fixed="OBS"/>
		<xs:attribute name="moodCode" type="x_ActMoodDocumentObservation" use="required" fixed="EVN"/>
		<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
	</xs:complexType>
	<xs:complexType name="POCD_MT000040.Act">
		<xs:sequence>
			<xs:element name="code" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>кодируемое поле</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:complexContent>
						<xs:restriction base="CE_non_elements"> 
							<xs:attribute name="code" type="cs" use="required"/>
							<xs:attribute name="codeSystem" type="uid" use="required"/>
							<xs:attribute name="codeSystemName" type="st" use="required"/>
							<xs:attribute name="codeSystemVersion" type="st" use="required"/>
							<xs:attribute name="displayName" type="st" use="required"/>
							<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
						</xs:restriction>
					</xs:complexContent>
				</xs:complexType>
			</xs:element>
			<xs:element name="text" type="ED_text" minOccurs="0" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>примечание к документу</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="effectiveTime" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>дата</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:complexContent>
						<xs:restriction base="TS"> 
							<xs:attribute name="value" type="ts" use="required"/>
							<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
						</xs:restriction>
					</xs:complexContent>
				</xs:complexType>
			</xs:element>
			<xs:element name="entryRelationship" minOccurs="0" maxOccurs="2">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="observation" type="POCD_MT000040.Observation_DOC" minOccurs="1" maxOccurs="1"/>
					</xs:sequence>
					<xs:attribute name="typeCode" type="x_ActRelationshipEntryRelationship" use="required" fixed="COMP"/>
				</xs:complexType>
			</xs:element>
			<xs:element name="reference" type="POCD_MT000040.Reference" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>ссылка на документ</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
		<xs:attribute name="classCode" type="x_ActClassDocumentEntryAct" use="required" fixed="ACT"/>
		<xs:attribute name="moodCode" type="x_DocumentActMood" use="required" fixed="EVN"/>
	</xs:complexType>
	<xs:complexType name="POCD_MT000040.Observation_DOC">
		<xs:sequence>
			<xs:element name="code" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>код поля</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:complexContent>
						<xs:restriction base="CE_non_elements">
							<xs:attribute name="code" use="required">
								<xs:simpleType>
									<xs:restriction base="cs">
										<xs:enumeration value="11002"/>
										<xs:enumeration value="11003"/>
									</xs:restriction>
								</xs:simpleType>
							</xs:attribute>
							<xs:attribute name="codeSystem" type="uid" use="required" fixed="1.2.643.5.1.13.13.99.2.166"/>
							<xs:attribute name="codeSystemName" type="st" use="required"/>
							<xs:attribute name="codeSystemVersion" type="st" use="required"/>
							<xs:attribute name="displayName" type="st" use="required"/>
							<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
						</xs:restriction>
					</xs:complexContent>
				</xs:complexType>
			</xs:element>
			<xs:element name="value" type="ANY" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>наполнение кодируемого поля</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="classCode" type="ActClassObservation" use="required" fixed="OBS"/>
		<xs:attribute name="moodCode" type="x_ActMoodDocumentObservation" use="required" fixed="EVN"/>
		<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
	</xs:complexType>
	<xs:complexType name="POCD_MT000040.Reference">
		<xs:sequence>
			<xs:element name="externalDocument" type="POCD_MT000040.ExternalDocument" minOccurs="1" maxOccurs="1"/>
		</xs:sequence>
		<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
		<xs:attribute name="typeCode" type="x_ActRelationshipExternalReference" use="required" fixed="REFR"/>
	</xs:complexType>
	<xs:complexType name="POCD_MT000040.ExternalDocument">
		<xs:sequence>
			<xs:element name="id" minOccurs="1" maxOccurs="1">
				<xs:complexType>
					<xs:complexContent>
						<xs:restriction base="II">
							<xs:attribute name="assigningAuthorityName" type="st" use="prohibited"/>
							<xs:attribute name="displayable" type="bl" use="prohibited"/>
						</xs:restriction>
					</xs:complexContent>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="nullFlavor" type="NullFlavor" use="prohibited"/>
		<xs:attribute name="classCode" type="ActClassDocument" use="required" fixed="DOCCLIN"/>
		<xs:attribute name="moodCode" type="ActMood" use="required" fixed="EVN"/>
	</xs:complexType>
</xs:schema>